import json
import requests


def get():
    response = requests.get(url='https://v1.hitokoto.cn')
    result = json.loads(response.text)
    hitokoto = result['hitokoto']
    fromWhere = result['from']
    fromWho = result['from_who']

    str = hitokoto + '\n' + '————《' + fromWhere + '》'
    if fromWho != None:
        str = str + '  ' + fromWho
    return str


if __name__ == '__main__':
    print(get())
